<template>
  <div class="publish-bg">
    <div class="publish-card">
      <h2 class="publish-title">发布需求</h2>
      <el-form :model="form" label-width="100px" class="publish-form">
        <el-form-item label="需求类型：">
          <el-select v-model="form.type" placeholder="请选择需求类型" class="publish-select">
            <el-option label="商品买卖" value="商品买卖" />
            <el-option label="问题求助" value="问题求助" />
            <el-option label="代购/代办" value="代购/代办" />
            <el-option label="宠物照看" value="宠物照看" />
            <el-option label="物品交换" value="物品交换" />
            <el-option label="其他" value="其他" />
          </el-select>
        </el-form-item>
        <el-form-item label="需求标题：">
          <el-input v-model="form.title" placeholder="请输入需求标题" />
        </el-form-item>
        <el-form-item label="需求描述：">
          <el-input v-model="form.description" type="textarea" :rows="4" placeholder="请详细描述您的需求..." />
        </el-form-item>
        <el-form-item label="上传图片：">
          <el-upload class="upload-demo" drag action="#" :show-file-list="false" :limit="5" :auto-upload="false">
            <i class="el-icon-plus upload-icon"></i>
            <div class="el-upload__text">点击或拖拽上传图片</div>
            <div class="el-upload__tip">最多上传 5 张图片，单张不超过 5MB</div>
          </el-upload>
        </el-form-item>
        <div class="publish-row">
          <el-form-item label="预算金额：" class="publish-col">
            <el-input v-model="form.budget" placeholder="请输入预算金额" />
          </el-form-item>
          <el-form-item label="截止时间：" class="publish-col">
            <el-date-picker v-model="form.deadline" type="date" placeholder="截止时间" style="width: 100%" />
          </el-form-item>
        </div>
        <div class="publish-row">
          <el-form-item label="联系人：" class="publish-col">
            <el-input v-model="form.contactName" placeholder="请输入联系人姓名" />
          </el-form-item>
          <el-form-item label="联系电话：" class="publish-col">
            <el-input v-model="form.contactPhone" placeholder="请输入联系电话" />
          </el-form-item>
        </div>
        <el-form-item>
          <div class="publish-btn-wrap">
            <el-button type="primary" size="large" class="publish-btn">发布需求</el-button>
          </div>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script setup>
import { ref } from "vue";
const form = ref({
  type: "",
  title: "",
  description: "",
  budget: "",
  deadline: "",
  contactName: "",
  contactPhone: "",
});
</script>
<style scoped>
.publish-bg {
  min-height: 100vh;
  background: #f7f9fb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}
.publish-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 32px #e3e8f0;
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 36px 32px 36px;
}
.publish-title {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 32px;
  letter-spacing: 2px;
}
.publish-form {
  width: 100%;
}
.publish-select {
  width: 100%;
}
.upload-demo {
  width: 100%;
  margin-bottom: 0;
}
.upload-icon {
  font-size: 32px;
  color: #b3b3b3;
  margin-bottom: 8px;
}
.publish-row {
  display: flex;
  gap: 18px;
}
.publish-col {
  flex: 1;
}
.publish-btn-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.publish-btn {
  width: 180px;
  height: 44px;
  font-size: 16px;
  border-radius: 24px;
  font-weight: bold;
  background: linear-gradient(90deg, #6a8dff 0%, #4fd1c5 100%);
  color: #fff;
  border: none;
}
</style>
